import pandas as pd
import ast
import matplotlib.pyplot as plt

df = pd.read_csv('training_merge.csv')

allRssi = []
def parse_array(value):
    global allRssi
    value = str(value)
    if value.startswith('['):
        a = ast.literal_eval(value)
        allRssi += a
        return len(a)
    else:
        return ''

for colName in df.columns:
    if ('max' in colName):
        print('NOW:', colName)
        df[colName] = df[colName].apply(parse_array)

import statistics
print('mean', statistics.mean(allRssi), 'median', statistics.median(allRssi), 'var', statistics.variance(allRssi))